<template>
    <a-card size="small" :bordered="false" :hoverable="true">
        <template #title>
            <div style="margin: 10px 0px 20px 0px;font-size:16px;color: #1677ff;">申报记录</div>
        </template>
        <template #extra>
            <a-tooltip title="返回上级">
                <a-button size="middle" @click="goback">
                    <template #icon>
                        <RollbackOutlined />
                    </template>
                </a-button>
            </a-tooltip>
        </template>
        <!---------- 表格 begin ----------->
        <a-table size="small" :dataSource="tableData" :columns="columns" rowKey="blfunduseid" bordered
            :loading="tableLoading" :pagination="false">
        </a-table>
        <!---------- 表格 end ----------->
        <!-- 分页-->
        <!-- <div class="smart-query-table-page">
            <a-pagination showSizeChanger showQuickJumper show-less-items :pageSizeOptions="PAGE_SIZE_OPTIONS"
                :defaultPageSize="queryForm.limit" v-model:current="queryForm.page" v-model:pageSize="queryForm.limit"
                :total="total" @change="queryData" @showSizeChange="queryData" :show-total="(total) => `共${total}条`" />
        </div> -->
    </a-card>

</template>

<script setup>
    import { nextTick, reactive, ref, defineProps, onMounted, h } from 'vue';
    import { ProManageApi } from '/@/api/ProManage/ProManage-api';
    import AreaCascader from '/@/components/framework/area-cascader/index.vue';
    import { SmartLoading } from '/@/components/framework/smart-loading';
    import Upload from '/@/components/support/file-upload/index.vue';
    import { regular } from '/@/constants/regular-const';
    import { message, Modal } from 'ant-design-vue';
    import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
    import { smartSentry } from '/@/lib/smart-sentry';
    import _ from 'lodash';
    import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
    const props = defineProps({
        passData: {
            type: Object,
        },
    })

    // --------------------- modal 显示与隐藏 ---------------------
    // 是否展示
    const visible = ref(false);


    const emits = defineEmits(['emitPass'])
    function goback() {
        let obj = {
            type: 0,
        };
        emits('emitPass', obj);
    }
    // ---------------------------- 表格列 ----------------------------
    const columns = ref([
        {
            title: '项目名称',
            dataIndex: 'blprojectname',
            align: 'center',
        },
        {
            title: '操作人',
            dataIndex: 'blext3',
            align: 'center',
        },
        {
            title: '操作时间',
            dataIndex: 'blactiondate',
            align: 'center',
            sorter: {
                compare: (a, b) => new Date(a.blactiondate) - new Date(b.blactiondate),
            },
        },
        {
            title: '操作类型',
            dataIndex: 'blaction',
            align: 'center',
        },
    ]);

    const queryFormState = {
        page: 1,
        limit: PAGE_SIZE,
    };
    // 查询表单form
    const queryForm = reactive({ ...queryFormState });
    // 表格加载loading
    const tableLoading = ref(false);
    // 表格数据
    const tableData = ref([]);
    // 总数
    const total = ref(0);


    // 查询数据
    async function queryData() {
        tableLoading.value = true;
        try {
            const paramsId = props.passData.blclosureid
            let queryResult = await ProManageApi.getLog(paramsId);
            tableData.value = queryResult.data;
            total.value = queryResult.data.length;
        } catch (e) {
            smartSentry.captureError(e);
        } finally {
            tableLoading.value = false;
        }
    }
    onMounted(queryData);

</script>

<style lang="less" scoped>
    .form-width {
        width: 100% !important;
    }

    .footer {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    :deep(.ant-card-body) {
        padding: 10px;
    }

    .endWord {
        margin: 0 0 10px 0;
        font-size: 18px;
    }
</style>